import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/layout',
      name: 'Layout',
      component: () => import('../views/layout.vue'),
      children: [
        {
          path: 'home',
          name: 'home',
          component: () => import('../views/home/index.vue')
        }, {
          path: 'product',
          name: 'product',
          component: () => import('../views/product.vue')
        },
        {
          path: 'order',
          name: 'order',
          component: () => import('../views/order.vue')
        },
        {
          path: 'user',
          name: 'user',
          component: () => import('../views/user.vue')
        },
        {
          path: 'settings',
          name: 'settings',
          component: () => import('../views/system/settings.vue')
        },
      ]
    },

    {
      path: '/login',
      name: 'Login',
      component: () => import('../views/login/login.vue')
    },
    {
      path: '/update-password',
      name: 'UpdatePassword',
      component: () => import('../views/login/UpdatePassword.vue')
    },
    {
      path: '/forget-password',
      name: 'ForgetPassword',
      component: () => import('../views/login/ForgetPassword.vue')
    },
  ]
})

export default router    